#BEGIN

OCAML=ocamlopt
LABLGL=-I +lablGL -ccopt -L. lablgl.cmxa lablglut.cmxa
LABLGTK=-I +lablgtk2 lablgtk.cmxa lablgtkgl.cmxa
DEP=dynArray.cmx geometry.cmx objExporter.cmx tesselator.cmx imgprocess.cmx objLoader.cmx camera.cmx graphics.cmx colors.cmx alldatas.cmx imgbutton.cmx glcalls.cmx guismall.cmx guigl.cmx guiminimap.cmx guiapropos.cmx noisecorrection.cmx

SDL=-I +sdl bigarray.cmxa sdl.cmxa sdlloader.cmxa str.cmxa

all: progeo

progeo: dynArray.cmx geometry.cmx objExporter.cmx tesselator.cmx imgprocess.cmx objLoader.cmx camera.cmx colors.cmx alldatas.cmx imgbutton.cmx glcalls.cmx guismall.cmx guigl.cmx guiminimap.cmx gui.cmi guiapropos.cmx noisecorrection.cmx

	ln -sf /usr/lib/libglut.so.3.9.0 libglut.so
	ln -sf /usr/lib/libgtkgl-2.0.so.1 libgtkgl-2.0.so
	${OCAML} ${LABLGL} ${LABLGTK} ${SDL} ${DEP} -o progeo gui.ml

dynArray.cmx: dynArray.cmi
	${OCAML} -c dynArray.ml
dynArray.cmi: 
	${OCAML} -c dynArray.mli

geometry.cmx: geometry.cmi
	${OCAML} -c geometry.ml
geometry.cmi: 
	${OCAML} -c geometry.mli

objExporter.cmx: objExporter.cmi
	${OCAML} -c objExporter.ml
objExporter.cmi: 
	${OCAML} -c objExporter.mli

tesselator.cmx: tesselator.cmi
	${OCAML} ${SDL} -c tesselator.ml
tesselator.cmi: 
	${OCAML} ${SDL} -c tesselator.mli

imgprocess.cmx: imgprocess.cmi
	${OCAML} ${SDL} -c imgprocess.ml
imgprocess.cmi: 
	${OCAML} ${SDL} -c imgprocess.mli

objLoader.cmx: objLoader.cmi
	${OCAML} -c objLoader.ml
objLoader.cmi: 
	${OCAML} -c objLoader.mli

camera.cmx: camera.cmi
	${OCAML} -c camera.ml
camera.cmi: 
	${OCAML} -c camera.mli

graphics.cmx: graphics.cmi
	${OCAML} ${LABLGL} -c graphics.ml
graphics.cmi: 
	${OCAML} ${LABLGL} -c graphics.mli

colors.cmx: colors.cmi
	${OCAML} ${SDL} -c colors.ml
colors.cmi: 
	${OCAML} ${SDL} -c colors.mli

alldatas.cmx: alldatas.cmi
	${OCAML} -c alldatas.ml
alldatas.cmi: 
	${OCAML} -c alldatas.mli

imgbutton.cmx: imgbutton.cmi 
	${OCAML} ${LABLGTK} -c imgbutton.ml
imgbutton.cmi: 
	${OCAML} ${LABLGTK} -c imgbutton.mli

glcalls.cmx: graphics.cmx glcalls.cmi 
	${OCAML} ${LABLGL} graphics.cmx -c glcalls.ml
glcalls.cmi: 
	${OCAML} ${LABLGL} graphics.cmx -c glcalls.mli

guismall.cmx: guismall.cmi
	${OCAML} ${SDL} ${LABLGTK} -c guismall.ml
guismall.cmi: 
	${OCAML} ${SDL} ${LABLGTK} -c guismall.mli

guigl.cmx: guigl.cmi
	${OCAML} ${LABLGL} ${LABLGTK} -c guigl.ml
guigl.cmi: 
	${OCAML} ${LABLGL} ${LABLGTK} -c guigl.mli

guiminimap.cmx: guiminimap.cmi
	${OCAML} ${LABLGTK} -c guiminimap.ml
guiminimap.cmi: 
	${OCAML} ${LABLGTK} -c guiminimap.mli
guiapropos.cmx: guiapropos.cmi
	${OCAML} ${LABLGTK} -c guiapropos.ml
guiapropos.cmi:
	${OCAML} ${LABLGTK} -c guiapropos.mli
noisecorrection.cmx: noisecorrection.cmi
	${OCAML} ${SDL} -c noisecorrection.ml
noisecorrection.cmi:
	${OCAML} ${SDL} -c noisecorrection.mli

gui.cmi: 
	${OCAML} ${LABLGL} ${LABLGTK} ${SDL} ${DEP} -c gui.mli

clean::
	rm -f *~ *.o *.cm? progeo colorsValues dist_test colors graphicGL geometry dynArray tesselator libglut.so

install:
	make
	cp ./progeo /usr/local/bin
	mkdir /usr/share/progeo
	cp ./res/* /usr/share/progeo/.
	make clean

uninstall:
	rm -rf /usr/local/bin/progeo
	rm -rf /usr/share/progeo

#END
